#include "stdafx.h"


#include "QSemaphore.h"
using namespace micro::core;


#include "qerror.h"
using namespace micro::utils;


QSemaphore::QSemaphore( long initialCount, long maxCount, const TCHAR * name, LPSECURITY_ATTRIBUTES sa ) 
{
	m_hHandle = ::CreateSemaphore( sa, initialCount, maxCount, name );

	if ( m_hHandle == NULL )
	{
		throw QError();// "Failed to create a semaphore", GetLastError() );
	}
}

QSemaphore::~QSemaphore(void)
{
	//Close in base clase
}
